package client

import (
	"context"

	"mini-app/internal/app/grpc/protoc/sale_adminc"

	"192.168.1.75/go-pkg/errorx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/svsdis"
)

// GetSaleAdminClient 获取grpc客户端
func GetSaleAdminClient() (sale_adminc.SaleAdminServiceClient, error) {
	conn, err := svsdis.GRPCConn("sale-admin")
	if err != nil {
		logx.Error(context.Background(), "GetSaleAdminClient err")
		return nil, errorx.New("获取服务失败", -1)
	}
	cli := sale_adminc.NewSaleAdminServiceClient(conn)
	return cli, nil
}
